<div class="wrap">
{if $page_message == null}
	<div id="ajaxResponse_page" class="ajaxResponse"></div>
{else}
	<div id="ajaxResponse_page" class="ajaxResponse fade" style="display:block">{$page_message}</div>
{/if}
<h2>Page Management</h2>
	<table width="100%">
		<tr>
			<td width="50%">
			<form method="post" action="?module={$smarty.get.module}&sub1=page&act=search">
				<label for="search_key">Search Pages ...</label><br />
				<input type="text" name="s" id="search_key" value="{$smarty.post.s}" size="20">
				<span class="submit" align="right">
					<input type="image" name="submit" src="../view/admin/images/object_search.png" value="" />
				</span>
			</form>
			</td>
		
			<td>
			<form method="post" action="?module={$smarty.get.module}&sub1=page&act=browse_cat">
				<label for="cat">Browse By Category ...</label><br />
				<select name='cat' id='cat' class='postform'>
		  				<option value=''>None</option>
			  			{foreach name=cat from=$CATS item=item}
				  			{if $item->cat_id == $smarty.post.cat}
			  					<option selected id='cat_parent-{$item->cat_id}' value='{$item->cat_id}'>
				  			{else}
								<option id='cat_parent-{$item->cat_id}' value='{$item->cat_id}'>
							{/if}
							{$item->temp_name|replace:"—":"&nbsp;&nbsp;&nbsp;"}
							</option>
						{/foreach}
				</select>
				<span class="submit" align="right">
					<input type="image" name="submit" src="../view/admin/images/object_search.png" value="" />
				</span>
			</form>
			</td>
		</tr>
	</table>
	
	<table class="widefat">
		<thead>
		{if $COMMENT != ""}
		<tr>
			<th scope="col" colspan="6" style="text-align: center">
				{$COMMENT}
			</th>
		</tr>
		{/if}
		<tr>
			<th scope="col" style="text-align: center">ID</th>
	        <th scope="col">Title</th>
	        <th scope="col" style="text-align: center">Status</th>
	        <th scope="col" style="text-align: center">Owner</th>
	        <th colspan="2" style="text-align: center">Action</th>
		</tr>
		</thead>
		<tbody id="pagetable">
			{foreach name=page from=$PAGES.data item=item}
				<tr id="page-{$item->page_id}" class="{cycle values=,alternate}">
					<th scope='row' style='text-align: center'>{$item->page_id}</th>
					<td>{$item->page_name}</td>
					<td align='center'>{$item->page_status}</td>
					<td align='center'>{$item->user_name|default:"-"}</td>
					<td>
                    	<a href="?module={$smarty.get.module}&sub1=page&act=editpage&id={$item->page_id}" class='edit'>Edit</a></td>
					<td><a onclick="onDeletePage('?module={$smarty.get.module}&sub1=page', '{$item->page_id}', 'ajaxResponse_page')" 
							class='delete'>Delete</a></td>
				</tr>
			{/foreach}
		</tbody>
	</table>
    {if $PAGES.data != NULL}
     <div>			
              <div style="width:300px; float:left"> 
                  Seiten : {$PAGES.TOTAL} Von {$PAGES.TOTALDATA}
              </div>			
              <div style="width:300px; text-align:right; float:right" >{$PAGES.FIRST} {$PAGES.PRE}&nbsp;{$PAGES.LISTPAGE} Von &nbsp; {$PAGES.TOTALPAGE} &nbsp;                   
                  <select onchange="javascript:window.location='{$PAGES.LINK}&{$PAGES.PATHNAME}='+this.value">
                    {$PAGES.COMBOPAGE}                     
                  </select>&nbsp;{$PAGES.NEXT} {$PAGES.LAST}         
              </div>
              <div style="clear:both"></div>		
    </div>	     
    {/if}   
	<p>
		<a href="?module={$smarty.get.module}&sub1=page&act=newpage">
				<b>Create New Page &raquo;</b></a>
	</p>
</div>
